/*
 * @Author: benchenchuang benchenchuang
 * @Date: 2023-07-19 21:26:22
 * @LastEditors: benchenchuang benchenchuang
 * @LastEditTime: 2023-08-20 16:25:58
 * @FilePath: /hmp-web/src/api/supervision/approve.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import request from '@/utils/request';

/**
 * 施工方案列表，提交按钮
 */
export const submitInfo = (id, leaderid) => {
    return request.get(`/sys/schemeWorkFlow/createFlowForCollect?schemeId=${id}&leaderId=${leaderid}`);
    // return request.get(`/sys/schemeWorkFlow/createFlow?schemeId=${id}&leaderId=${leaderid}`);
};

/**
 * @description 查询列表
 */
export const remoteList = params => {
    return request.get('/sys/schemeWorkFlow/queryForCollect', params);
    // return request.get('/sys/schemeWorkFlow/query', params);
};

/**
 * 同意
 */
export const agreeInfo = data => {
    return request.post(`/sys/schemeWorkFlow/approveActionForCollect`, data);
    // return request.post(`/sys/schemeWorkFlow/approveAction`, data);
}; 

/**
 * 驳回
 */
export const rejectInfo = data => {
    return request.post('/sys/schemeWorkFlow/returnActionForCollect', data);
    // return request.post('/sys/schemeWorkFlow/returnAction', data);
};

/**施工审批列表，每行数据的"查看"按钮 */
export const getFlowTrackList = id => {
    return request.get(`/sys/schemeWorkFlow/queryFlow?schemeId=${id}`);
};

/**查询审批流程中所有轨迹的接口 */
export const getFlowTrackHistoryList = id => {
    return request.get(`/sys/schemeWorkFlow/queryTrack?schemeId=${id}`);
};

export default {
    remoteList
};
